trait Position {}
struct Coordinates(f64, f64);
impl Position for Coordinates {}

fn main() {
    let val = Coordinates(1.0, 2.0);
    let ref_: &Coordinates = &val;
    let pos_ref: &dyn Position = &val as &dyn Position;
    let ptr: *const Coordinates = &val as *const Coordinates;
    let pos_ptr: *const dyn Position = &val as *const dyn Position;

    // 特征对象和指向特征的引用是胖指针，它们是普通指针大小的两倍
    println!("ref_: {}", std::mem::size_of_val(&ref_));       // 8
    println!("ptr: {}", std::mem::size_of_val(&ptr));         // 8
    println!("val: {}", std::mem::size_of_val(&val));         // 16
    println!("pos_ref: {}", std::mem::size_of_val(&pos_ref)); // 16
    println!("pos_ptr: {}", std::mem::size_of_val(&pos_ptr)); // 16
}